#ifndef WIDGET_READER_H
#define WIDGET_READER_H

#include "Widget_Reader_TextBox.h"
#include "TreeItem_Book.h"

#include <QtGui/QLabel>
#include <QtGui/QWidget>
#include <QtGui/QTreeWidget>

namespace Jonathan
{

   class Widget_Reader : public QWidget
   {
       Q_OBJECT
   public:
       explicit Widget_Reader       (QWidget *parent = 0);
      void OpenBook                 ();
      void Read                     (TreeItem_Book* book, QString subBook, QString chapter);
      void Read                     (QString subBook, QString chapter);
      void SetTabIndex              (int index);

   signals:
      void TitleChanged             (QString title, int tabIndex);

   public slots:
      void TreeItemChanged          ();
      void PreviousChapter          ();
      void NextChapter              ();

   private:
      Widget_Reader_TextBox*        m_Reader;
      TreeItem_Book*                m_Book;
      QTreeWidget*                  m_BookList;
      QLabel*                       m_Title;
      int                           m_TabIndex;

      QTreeWidgetItem* CopyTreeItem (QTreeWidgetItem* itemToCopy, BookItemType type);
   };

}

#endif // WIDGET_READER_H
